package com.wutu.nbyjk8.enums;

/**
 * @Author: Addons
 * @Date: 2022-02-23 11:31
 * @Desc:
 */
public enum SmartLightCodeEnum {
    UNKNOWN_ERR(0, "未知错误"),
    SUCCESS(1, "成功"),
    ENTITY_ID_ERR(1005, "实体类主键类型错误"),
    PARAM_MISS_ERR(1006, "非法请求，缺少请求参数项！"),
    ILLEGALITY_REQ(1007, "非法请求，参数项不符合要求！"),
    USER_INFO_ERR(2004, "用户名或密码错误， 请重新输入！"),
    TOKEN_ERR(2008, "令牌失效，客户端需重 新登录！"),
    SESSION_ERR(20090, "会话失效，客户端需 重新登录！");


    private Integer code;
    private String msg;


    private SmartLightCodeEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }


    public static String getCodeMsg(Object code) {
        if (null != code) {
            for (SmartLightCodeEnum smartLightCodeEnum : SmartLightCodeEnum.values()) {
                if (code.equals(smartLightCodeEnum.getCode())) {
                    return smartLightCodeEnum.getMsg();
                }
            }
        }
        return "三方接口未知错误";
    }

}
